

from django.db.models import CharField,IntegerField,ForeignKey,DO_NOTHING,TextField,DateField,DateTimeField,BooleanField
from apps.vadmin.op_drf.models import CoreModel


"""
附属品借用给人且需要归还
"""
class AccessoryRecords(CoreModel):
    accessory= ForeignKey(to="assets.Accessories",null=True,db_constraint=False,on_delete=PROTECT,verbose_name="借出附属品Id")
    assigned_to = ForeignKey(to="permission.UserProfile",null=True,db_constraint=False,on_delete=PROTECT,related_name='accessory_assigned_to',verbose_name="借用人")
    checkin_datetime = DateTimeField(null=True,verbose_name="实际归还时间")
    is_checkin = BooleanField(null=True,default=0,verbose_name="是否归还")
    checkout_notes = TextField(null=True,verbose_name="借出备注")
    checkin_notes = TextField(null=True,verbose_name="归还备注")


    class Meta:
        verbose_name = '附属品借用归还记录表'
        verbose_name_plural = verbose_name
